﻿using Iesi.Collections.Generic;
using Newtonsoft.Json;
using System;
using System.ComponentModel.DataAnnotations;

namespace Romantics.Domain.Objects
{
    public class Category : NamedEntity
    {
        [Required(ErrorMessage = "URL: Обязательное поле")]
        [StringLength(200, ErrorMessage = "URL: Длина не должна превышать 200 символов")]
        public virtual string URL { get; set; }
        public virtual string Meta { get; set; }
        
        private ISet<Hike> hikes = new HashedSet<Hike>();

        [JsonIgnore]
        public virtual ISet<Hike> Hikes
        {
            get { return hikes; }
            set { hikes = value; }
        }
    }
}
